package vip.aning.gitsync.service;

import org.slf4j.LoggerFactory;
import vip.aning.gitsync.constant.AppConst;
import vip.aning.gitsync.job.QuartzManager;

public class JobService {
    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(JobService.class);
    public static void addJob(Class jobClass, String cron) {
        LOG.info("添加GitSyncJob");
        QuartzManager.addJob(AppConst.JOB_NAME,
                AppConst.JOB_GROUP_NAME,
                AppConst.TRIGGER_NAME,
                AppConst.TRIGGER_GROUP_NAME,
                jobClass,
                cron);
    }

    public static void removeGitSyncJob() {
        LOG.info("移除GitSyncJob");
        QuartzManager.removeJob(AppConst.JOB_NAME,
                AppConst.JOB_GROUP_NAME,
                AppConst.TRIGGER_NAME,
                AppConst.TRIGGER_GROUP_NAME);
    }
}
